home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Libraries / MacOS 68K / MathLib68K / MathLib68K Sources / ANSImath_glue(float).c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-22  |  3.2 KB  |  171 lines  |  [TEXT/MMCC]

  1. /*
  2.  *    math.h glue functions (float precision math) ...
  3.  */
  4.  
  5. #ifndef __FP__
  6. #include <fp.h>
  7. #endif
  8.  
  9. /*
  10.  *    We can't include both fp.h and math.h since their definitions of cos, etc... conflict
  11.  */
  12.  
  13. #ifdef cplusplus
  14. extern "C" {
  15. #endif
  16. float cosf(float);
  17. float sinf(float);
  18. float tanf(float);
  19. float acosf(float);
  20. float asinf(float);
  21. float atanf(float);
  22. float atan2f(float, float);
  23. float coshf(float);
  24. float sinhf(float);
  25. float tanhf(float);
  26. float expf(float);
  27. float frexpf(float, int *);
  28. float ldexpf(float, int);
  29. float logf(float);
  30. float log10f(float);
  31. float modff(float, float *);
  32. float fabsf(float);
  33. float powf(float, float);
  34. float sqrtf(float);
  35. float ceilf(float);
  36. float floorf(float);
  37. float fmodf(float, float);
  38. #ifdef cplusplus
  39. }
  40. #endif
  41.  
  42. /*******************************************************************************
  43. *                            Trigonometric functions                           *
  44. *******************************************************************************/
  45.  
  46. float cosf(float x)
  47. {
  48.     return((cos)(x));
  49. }
  50.  
  51. float sinf(float x)
  52. {
  53.     return((sin)(x));
  54. }
  55.  
  56. float tanf(float x)
  57. {
  58.     return((tan)(x));
  59. }
  60.  
  61. float acosf(float x)
  62. {
  63.     return((acos)(x));
  64. }
  65.  
  66. float asinf(float x)
  67. {
  68.     return((asin)(x));
  69. }
  70.  
  71. float atanf(float x)
  72. {
  73.     return((atan)(x));
  74. }
  75.  
  76. float atan2f(float x, float y)
  77. {
  78.     return((atan2)(x,y));
  79. }
  80.  
  81. /*******************************************************************************
  82. *                              Hyperbolic functions                            *
  83. *******************************************************************************/
  84.  
  85. float coshf(float x)
  86. {
  87.     return((cosh)(x));
  88. }
  89.  
  90. float sinhf(float x)
  91. {
  92.     return((sinh)(x));
  93. }
  94.  
  95. float tanhf(float x)
  96. {
  97.     return((tanh)(x));
  98. }
  99.  
  100. /*******************************************************************************
  101. *                              Exponential functions                           *
  102. *******************************************************************************/
  103.  
  104. float expf(float x)
  105. {
  106.     return((exp)(x));
  107. }
  108.  
  109. float frexpf(float x, int *exponent)
  110. {
  111.     return((frexp)(x,exponent));
  112. }
  113.  
  114. float ldexpf(float x, int n)
  115. {
  116.     return((ldexp)(x,n));
  117. }
  118.  
  119. float logf(float x)
  120. {
  121.     return((log)(x));
  122. }
  123.  
  124. float log10f(float x)
  125. {
  126.     return((log10)(x));
  127. }
  128.  
  129. /*******************************************************************************
  130. *                     Power and absolute value functions                       *
  131. *******************************************************************************/
  132.  
  133. float fabsf(float x)
  134. {
  135.     return((fabs)(x));
  136. }
  137.  
  138. float powf(float x, float y)
  139. {
  140.     return((pow)(x,y));
  141. }
  142.  
  143. float sqrtf(float x)
  144. {
  145.     return((sqrt)(x));
  146. }
  147.  
  148. /*******************************************************************************
  149. *                        Nearest integer functions                             *
  150. *******************************************************************************/
  151.  
  152. float ceilf(float x)
  153. {
  154.     return((ceil)(x));
  155. }
  156.  
  157. float floorf(float x)
  158. {
  159.     return((floor)(x));
  160. }
  161.  
  162. /*******************************************************************************
  163. *                            Remainder functions                               *
  164. *******************************************************************************/
  165.  
  166. float fmodf(float x, float y)
  167. {
  168.     return((fmod)(x,y));
  169. }
  170.  
  171.